﻿using System;
using MathNet.Numerics.LinearAlgebra.Double;

namespace Marvin.Categorization.NeuronalNetworks
{
    public class NeuralNetwork:ICategorizationAlgorithm
    {
        private InputLayer _inputLayer;


        public InputLayer InputLayer
        {
            get { return _inputLayer; }
        }

        public NeuralNetwork(InputLayer inputLayer)
        {
            _inputLayer = inputLayer; 
        }

        public void Train(TrainingSet<uint> trainingSet)
        {
            throw new NotImplementedException();
        }

        public uint Predict(params uint[] x)
        {
            DenseVector input = Transform(x);
            return _inputLayer.Recognize(input);
        }

        private DenseVector Transform(uint[] inputs)
        {
            var vector = new DenseVector(inputs.Length);

            for (int index = 0; index < inputs.Length; index++)
            {
                vector[index] = inputs[index];
            }

            return vector; 
        }
    }
}
